package com.lhf.spareClass.mapper;

import com.lhf.spareClass.model.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 尐痞猫
 * @date2021-06-25 23:29
 */
@Mapper
public interface SpareMapper {

    List<SpareVo> likeCode(SpareLikeQuery spareLikeQuery);

    SpareVo queryByCode(String code);

    List<SubClassVo> subClass();


    List<SpareVo> queryPage(SpareSelectVo spareSelectVo);

    Integer queryCount();

    int update(SpareVo spareVo);

    int add(SpareVo spareVo);

    List<SpareQueryVo> queryByLegalPersonCode(String legalPersonCode);
    List<SubClassQueryVo> queryByLegalPersonCode2(String legalPersonCode);

    @Select("select count(id) from legalperson_spareclass where legalpersonCode = #{legalpersonCode} and spareclassCode = #{spareclassCode}")
    int selectByCode(@Param("spareclassCode") String code, @Param("legalpersonCode")String legalPersonCode);

    List<SpareQueryVo> select(String legalPersonCode);
}
